﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
create TRIGGER [dbo].[trg_inventoryAdjustment]
   ON  [dbo].[InventoryAdjustmentMMC]
   AFTER update
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for trigger here
	insert into InventoryAdjustmentMMC_history
	(
		    InventoryAdjustmentMMCID 
		    ,InventoryAdjustmentTypeID
		    ,InventoryItemByVendorID
		    ,oldquant
		    ,newquant
		    ,userUpdatedID
		    ,dateUpdated
		    ,notes
	)
	
	 
	
	SELECT 
		    InventoryAdjustmentMMCID 
		    ,InventoryAdjustmentTypeID
		    ,InventoryItemByVendorID
		    ,oldquant
		    ,newquant
		    ,userUpdatedID
		    ,dateUpdated
		    ,notes

      from deleted
	
	
END